<%--
  Created by IntelliJ IDEA.
  User: bin.liu
  Date: 2018/12/5
  Time: 11:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="/pages/sysIndex/default.jsp"/>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<div class="main-content">
    <div class="box box-main">
        <div class="box-header">
            <div class="box-title">
                <i class="fa icon-trophy"></i> 工时管理
            </div>
            <div class="box-tools pull-right">
                <a href="#" class="btn btn-default" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
                <%--<sec:authorize access="hasRole('ROLE_ENTERPRISE_MAINTAINING_WORKING_HOURS_EDIT')">--%>
                <%--<a href="javascript:;" onclick="vLayuiUtil.openLayerWindow('wTroubleCat', '<c:url--%>
                <%--value="/web/repair/troubleCat/editPage.action"/>','显示维护工单信息')" class="btn btn-default btnTool"--%>
                <%--title="显示维护工单信息"><i class="fa fa-plus"></i> 显示维护工单信息</a>--%>
                <%--</sec:authorize>--%>
            </div>
        </div>

        <div class="box-body">
            <form id="searchForm" action="<c:url value="/web/admin/workingHours/listJson.action"/>" method="post"
                  class="form-inline hide" data-page-no="1" data-page-size="20" data-order-by="">
                <div class="form-group">
                    <label class="control-label">搜索：</label>
                    <div class="control-inline">
                        <input type="text" id="searchCode" name="searchCode" value="" maxlength="64"
                               class="form-control width-120">
                    </div>
                </div>

                <div class="form-group">
                    <button type="submit" class="btn btn-primary btn-sm">查询</button>
                    <button type="reset" class="btn btn-default btn-sm">重置</button>
                </div>
            </form>

            <div style="overflow-x:auto">
                <table id="dataGrid"></table>
            </div>
            <div id="dataGridPage"></div>
        </div>
    </div>
</div>
<script>
    var selectIds = [];
    $('#dataGrid').dataGrid({
        searchForm: $("#searchForm"),
        shrinkToFit: false,
        autoScroll: true,
        columnModel: [
            {header: '工单号', name: 'orderCode', width: 200, align: "center", sortable: false},
            {header: '工单名', name: 'orderName', width: 200, align: "center", sortable: false},
            {header: '参与人', name: 'userName', width: 100, align: "center", sortable: false},
            {header: '工单类型', name: 'orderType', width: 100, align: "center", sortable: false},
            {header: '是否完成', name: 'completed', width: 100, align: "center", sortable: false},
            {header: '状态', name: 'status', width: 150, align: "center", sortable: false},
            {header: '开始日期', name: 'startDate', width: 120, align: "center", sortable: false},
            {header: '结束日期', name: 'endDate', width: 120, align: "center", sortable: false},
            {header: '开始时间', name: 'startTime', width: 100, align: "center", sortable: false},
            {header: '结束时间', name: 'endTime', width: 100, align: "center", sortable: false},
            {header: '实际工时', name: 'workingHours', width: 100, align: "center", sortable: false},
            {header: '所属企业', name: 'enterpriseName', width: 100, align: "center", sortable: false},
            {header: '发布时间', name: 'createDate', width: 150, align: "center", sortable: false}
        ],
        // onselectRow:function(id){
        //     var ids = $("#dataGrid").jqGrid("getGridParam", "selarrrow");
        //     if(ids.contains(id)){
        //
        //     }
        // },
        // 加载成功后执行事件
        ajaxSuccess: function (data) {

        },
    });


</script>
